//
//  FangdangListCell.m
//  WoChuangFuMini
//
//  Created by 陈贵邦 on 15/10/16.
//  Copyright © 2015年 陈贵邦. All rights reserved.
//

#import "FangdangListCell.h"

@implementation FangdangListCell
@synthesize netnumLabel,nameLabel,idnumberLabel,reamrkLabel;
- (instancetype)initWithFrame:(CGRect)frame
{
    
    CGFloat labelHeight = frame.size.height/5;
    CGFloat labelWidth = frame.size.width;
    self = [super initWithFrame:frame];
    if (self) {
        netnumLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, labelHeight, labelWidth, labelHeight)];
       
        
        nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, labelHeight*2, labelWidth, labelHeight)];
      
        idnumberLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, labelHeight*3, labelWidth, labelHeight)];
       
        
        reamrkLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 100, labelHeight*4, labelHeight)];
        
        [self addSubview:netnumLabel];
        [self addSubview:nameLabel];
        [self addSubview:idnumberLabel];
        [self addSubview:reamrkLabel];
        
    }
    return self;
}


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier withFrame:(CGRect)frame{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    self.frame = frame;
    if (self) {
        if (self) {
//            self.backgroundColor = [UIColor lightGrayColor];
            UIView *bgView = [[UIView alloc]initWithFrame:(CGRect){5,5,frame.size.width-10,frame.size.height-10}];
            bgView.backgroundColor = [UIColor colorWithHexString:@"#F4F4F4"];
            bgView.layer.cornerRadius = 10;
            [self addSubview:bgView];
           
            
            CGFloat labelHeight = bgView.frame.size.height/5;
            CGFloat labelWidth = bgView.frame.size.width;
            
            
            
            UILabel *netnumkey = [[UILabel alloc]initWithFrame:CGRectMake(0, labelHeight, 80, labelHeight)];
            netnumkey.text = @"入网号码:";
            [bgView addSubview:netnumkey];
            
            netnumLabel = [[UILabel alloc]initWithFrame:CGRectMake(80, labelHeight, labelWidth-80, labelHeight)];
            netnumLabel.textColor = [UIColor colorWithHexString:@"#696969"];
            
            
            UILabel *namenumkey = [[UILabel alloc]initWithFrame:CGRectMake(0, labelHeight*2, 80, labelHeight)];
            namenumkey.text = @"姓       名:";
            [bgView addSubview:namenumkey];
            nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(80, labelHeight*2, labelWidth-80, labelHeight)];
            nameLabel.textColor = [UIColor colorWithHexString:@"#696969"];
            
            
            UILabel *idnumberkey = [[UILabel alloc]initWithFrame:CGRectMake(0, labelHeight*3, 80, labelHeight)];
            idnumberkey.text = @"身份证号:";
            [bgView addSubview:idnumberkey];
            idnumberLabel = [[UILabel alloc]initWithFrame:CGRectMake(80, labelHeight*3, labelWidth-80, labelHeight)];
            idnumberLabel.textColor = [UIColor colorWithHexString:@"#696969"];
            
            
            
            UILabel *addresskey = [[UILabel alloc]initWithFrame:CGRectMake(0, labelHeight*4, 80, labelHeight)];
            addresskey.text = @"备       注:";
            [bgView addSubview:addresskey];
            reamrkLabel = [[UILabel alloc]initWithFrame:CGRectMake(80, labelHeight*4, labelWidth-80, labelHeight)];
            reamrkLabel.textColor = [UIColor colorWithHexString:@"#696969"];
            [bgView addSubview:netnumLabel];
            [bgView addSubview:nameLabel];
            [bgView addSubview:idnumberLabel];
            [bgView addSubview:reamrkLabel];
            
        }
    }
    return self;

}
@end
